package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.common.entity.QueryPageBean;
import com.itheima.pojo.Setmeal;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface SetmealDao {

    void add(Setmeal setmeal);

    void addSetmealAndCheckGroup(Integer setmealId, Integer checkGroupId);

    void update(Setmeal setmeal);

    @Delete("delete from t_setmeal_checkgroup where setmeal_id = #{setmealId}")
    void deleteSetmealAndCheckGroupBySetmealId(Integer setmealId);

    @Select("select * from t_setmeal where id = #{id}")
    Setmeal findById(Integer id);

    Page<Setmeal> findPage(QueryPageBean queryPageBean);
}
